[HVM] Allow xenbus to run in an HVM guest.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 17 Aug 2006 15:32:30 +0000 (16:32 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 17 Aug 2006 15:32:30 +0000 (16:32 +0100)
Signed-off-by: Steven Smith <ssmith@xensource.com>
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
unmodified_drivers/linux-2.6/Makefile
unmodified_drivers/linux-2.6/mkbuildtree
unmodified_drivers/linux-2.6/xenbus/Kbuild [new file with mode: 0644]

index 9668d6d7aee459dd761e9af4dc4c1ccf171c3cf4..a508e76461ff88dc9d077987c593b6a839a24282 100644 (file)
 
 #include <asm/io.h>
 #include <asm/page.h>
+#include <asm/maddr.h>
 #include <asm/pgtable.h>
 #include <asm/hypervisor.h>
 #include <xen/xenbus.h>
 #include <xen/xen_proc.h>
 #include <xen/evtchn.h>
 #include <xen/features.h>
+#include <xen/hvm.h>
 
 #include "xenbus_comms.h"
 
@@ -1015,13 +1017,21 @@ static int __init xenbus_probe_init(void)
                if (xsd_port_intf)
                        xsd_port_intf->read_proc = xsd_port_read;
 #endif
+               xen_store_interface = mfn_to_virt(xen_store_mfn);
        } else {
                xenstored_ready = 1;
+#ifdef CONFIG_XEN
                xen_store_evtchn = xen_start_info->store_evtchn;
                xen_store_mfn = xen_start_info->store_mfn;
+               xen_store_interface = mfn_to_virt(xen_store_mfn);
+#else
+               xen_store_evtchn = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN);
+               xen_store_mfn = hvm_get_parameter(HVM_PARAM_STORE_PFN);
+               xen_store_interface = ioremap(xen_store_mfn << PAGE_SHIFT,
+                                             PAGE_SIZE);
+#endif
        }
 
-       xen_store_interface = mfn_to_virt(xen_store_mfn);
 
        xenbus_dev_init();
 
index 37353776d72b7daff0682e3e0ec0ecf049623aa9..a7a52f8f9ed8840d3ac914f147eb33e657d69932 100644 (file)
@@ -1,3 +1,4 @@
 include $(M)/overrides.mk
 
 obj-m += platform-pci/
+obj-m += xenbus/
index 6002b2722d288afce1cec39b9fea0b916a6556f1..382a493796839e48622b8746b99e4e4cb4b69d14 100644 (file)
@@ -5,8 +5,15 @@ C=$PWD
 XEN=$C/../../xen
 XL=$C/../../linux-2.6-xen-sparse
 
+for d in $(find ${XL}/drivers/xen/ -maxdepth 1 -type d | sed -e 1d); do
+    if ! echo $d | egrep -q back; then
+        lndir $d $(basename $d) > /dev/null 2>&1
+    fi
+done
+
 ln -sf ${XL}/drivers/xen/core/gnttab.c platform-pci
 ln -sf ${XL}/drivers/xen/core/features.c platform-pci
+ln -sf ${XL}/drivers/xen/core/xen_proc.c xenbus
 
 mkdir -p include
 mkdir -p include/xen
diff --git a/unmodified_drivers/linux-2.6/xenbus/Kbuild b/unmodified_drivers/linux-2.6/xenbus/Kbuild
new file mode 100644 (file)
index 0000000..1a463ab
--- /dev/null
@@ -0,0 +1,10 @@
+include $(M)/overrides.mk
+
+obj-m  += xenbus.o
+xenbus-objs =
+xenbus-objs += xenbus_comms.o
+xenbus-objs += xenbus_xs.o
+xenbus-objs += xenbus_probe.o 
+xenbus-objs += xenbus_dev.o 
+xenbus-objs += xenbus_client.o 
+xenbus-objs += xen_proc.o